Skip to content

Conversation

@TroyKomodo
Copy link
Contributor

Adds installation steps for nix after #2518

likely should have been in that PR, but I forgot.. Sorry!

cc @nbp

maybe cc @doronbehar (upstream nixpkgs maintainer for sccache)

not sure if the upstream can take advantage of this create exporting a flake now, just pinging for awareness.

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.06%. Comparing base (782b151) to head (28e2348).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2523   +/-   ##
=======================================
  Coverage   71.06%   71.06%           
=======================================
  Files          64       64           
  Lines       35394    35394           
=======================================
  Hits        25153    25153           
  Misses      10241    10241           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TroyKomodo
Copy link
Contributor Author

I will also note that the lack of overlay for the definition of packages imply that this flake creates an additional instances of Nixpkgs (line 54: import nixpkgs) when using any of the modules, which is a bad practice.

(from previous PR)

I tried this flake on my system and I noticed it still does instantiate a separate version of nixpkgs shown by the flake.lock (i think)

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
    sccache.url = "github:troykomodo/sccache/cxx20-modules";
  };

  outputs = { self, nixpkgs, sccache, ... }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs {
        inherit system;
        overlays = [ sccache.overlays.default ];
      };
    in {
      devShells.${system}.default = pkgs.mkShell {
        buildInputs = [ pkgs.sccache ];
      };
    };
}

the flake.lock contains

{
  "nodes": {
    "flake-utils": {
      "inputs": {
        "systems": "systems"
      },
      "locked": {
        "lastModified": 1731533236,
        "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1765838191,
        "narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-25.11",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs_2": {
      "locked": {
        "lastModified": 1765838191,
        "narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-25.11",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "nixpkgs": "nixpkgs",
        "sccache": "sccache"
      }
    },
    "sccache": {
      "inputs": {
        "flake-utils": "flake-utils",
        "nixpkgs": "nixpkgs_2"
      },
      "locked": {
        "lastModified": 1766157939,
        "narHash": "sha256-n0N62klMafQFR1MvktplfR1RZMYX5D5V8T0M3FkiPDM=",
        "owner": "troykomodo",
        "repo": "sccache",
        "rev": "71e9190be7ca9c294be12f764b6f7205b3073780",
        "type": "github"
      },
      "original": {
        "owner": "troykomodo",
        "ref": "troy/cxx20-modules",
        "repo": "sccache",
        "type": "github"
      }
    },
    "systems": {
      "locked": {
        "lastModified": 1681028828,
        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
        "owner": "nix-systems",
        "repo": "default",
        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
        "type": "github"
      },
      "original": {
        "owner": "nix-systems",
        "repo": "default",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

Adding this to the inputs caused the nixpkgs to only be represented once.

sccache.inputs.nixpkgs.follows = "nixpkgs";

Only question is did mess up the overlay or is this expected and its actually fine?

@sylvestre sylvestre merged commit 5b4a557 into mozilla:main Dec 23, 2025
53 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants